#define _CRT_SECURE_NO_WARNINGS 1

#include "List.h"

void TestList1()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPrint(plist);

	LTPopBack(plist);
	LTPopBack(plist);
	LTPrint(plist);

	LTPushFront(plist, 0);
	LTPushFront(plist, -1);
	LTPrint(plist);

	LTPopFront(plist);
	LTPrint(plist);

	LTDestroy(plist);
	plist = NULL;
}

void TestList2()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPrint(plist);

	LTNode* pos = LTFind(plist, 3);
	if (pos)
	{
		LTInsert(pos, 5);
	}
	LTPrint(plist);

	LTNode* pos2 = LTFind(plist, 5);
	if (pos2)
	{
		LTErase(pos2);
		pos2 = NULL;
	}
	LTPrint(plist);

	LTErase(plist);
	LTPrint(plist);


	LTDestroy(plist);
	plist = NULL;
	
}
int main()
{
	TestList1();
	return 0;
}